package airlinesystem;

/**
 * Represents a booking in the Airline System
 * @author Robert Maaskant & Dennis van der Zwet
 *
 */
public class Booking
{
  /**
   * The passenger for whom this booking is
   */
  private PassengerRole passenger;
  /**
   * The flight which passenger booked
   */
  private SpecificFlight flight;
  /**
   * The seat the passenger booked on flight.
   */
  private int seatNumber;
  
 
  /**
   * The constructor for Booking
   * @param passenger the passenger that made this booking
   * @param flight the flight the passenger wants to book
   */
  public Booking(PassengerRole passenger, SpecificFlight flight, int seatNumber)
  {
    this.passenger = passenger;
    this.flight = flight;
    this.seatNumber = seatNumber;
    passenger.addBooking(this);
    flight.addBooking(this);
  }

  /**
   * Returns the PassengerRole associated with this booking 
   * @return the PassengerRole associated with this booking
   */
  public PassengerRole getPassengerRole()
  {
    return passenger;
  }

  /**
   * Returns the SpecificFlight associated with this booking
   * @return the SpecificFlight associated with this booking
   */
  public SpecificFlight getFlight()
  {
    return flight;
  }
  
  
}
